package com.cuixichang.minimalism.service;

import com.cuixichang.minimalism.transfer.dto.IFormDTO;
import com.cuixichang.minimalism.transfer.po.IForm;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.List;
import java.util.function.BiConsumer;
import java.util.function.Function;
/**
 * 拓展表单功能表服务接口
 *
 * @author cuixichang
 * @date 2024-12-18
 */
public interface IFormService{

    IFormDTO selectById(Long id);

    IFormDTO selectOne(IFormDTO iFormDTO);

    List<IFormDTO> selectByIds(List<Long> ids);

    List<IFormDTO> selectList(IFormDTO iFormDTO);

    List<IFormDTO> selectList(IFormDTO iFormDTO, BiConsumer<IForm, QueryWrapper<IForm>> consumer);

    Page<IFormDTO> selectPage(IFormDTO iFormDTO, long pageSize, long pageNo);

    Page<IFormDTO> selectPage(IFormDTO iFormDTO, long pageSize, long pageNo, BiConsumer<IForm, QueryWrapper<IForm>> consumer);

    int deleteById(Long id);

    int deleteByIds(List<Long> ids);

    int deleteByCondition(IFormDTO iFormDTO);

    int deleteByCondition(IFormDTO iFormDTO, BiConsumer<IForm, QueryWrapper<IForm>> consumer);

    IFormDTO insert(IFormDTO iFormDTO);

    IFormDTO insertHasOption(IFormDTO iFormDTO, Function<IFormDTO,IFormDTO> preOption);

    int updateById(IFormDTO iFormDTO);

    int updateById(IFormDTO iFormDTO, BiConsumer<IForm, UpdateWrapper<IForm>> consumer);
}